package com.zqc.code.remote;

import feign.Logger;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient(name = "zqc-service-email")
public interface EmailService {
    @RequestMapping(value = "/api/email/{email}/{code}", method = RequestMethod.GET)
    Boolean sendEmail(
            @PathVariable(value = "email") String email,
            @PathVariable(value = "code") String code
    );
}

@Configuration
class FeignConfig {
    @Bean
    Logger.Level feignLevel() {
        return Logger.Level.FULL;
    }
}
